<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-row>
                <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                    <el-form-item :label="PersonSafePlanManagement.activeName+mark.m" prop="activeName">
                        <el-input type="text" v-model="Form.activeName" autocomplete="off">
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                    <el-form-item :label="PersonSafePlanManagement.planMain+mark.m" prop="planMain">
                        <el-input type="textarea" v-model="Form.planMain" autocomplete="off">
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                    <label for="planDate" class="el-form-item__label"
                        style="width: 100%!important;line-height:28px">{{PersonSafePlanManagement.planDate}}:</label>
                    <el-date-picker v-model="Form.planDate" align="right" type="date" value-format="yyyy-MM-dd" size="mini"
                        placeholder="选择日期" :picker-options="pickerOptions">
                    </el-date-picker>
                </el-col>
                <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                    <label for="frequency" class="el-form-item__label"
                        style="width: 100%!important;line-height:28px">{{PersonSafePlanManagement.frequency}}:</label>
                    <el-form-item prop="frequency">
                        <el-select @visible-change="visibleChange" v-model="Form.frequency" :placeholder="PersonSafePlanManagement.frequency">
                            <el-option v-for="item in frequency" :label="item.value" :value="item.key"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                    <el-form-item :label="user.remarks+mark.m" prop="remarks">
                        <el-input type="textarea" v-model="Form.remarks" autocomplete="off">
                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="履职职责落实情况管理人员添加" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%"
            height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                    formInline: {
                        model: { name: '' },
                        offset: 0,
                        limit: 10
                    },
                    pickerOptions: {
                        disabledDate(time) {
                            return time.getTime() > Date.now();
                        },
                        shortcuts: [{
                            text: '今天',
                            onClick(picker) {
                                picker.$emit('pick', new Date());
                            }
                        }, {
                            text: '昨天',
                            onClick(picker) {
                                const date = new Date();
                                date.setTime(date.getTime() - 3600 * 1000 * 24);
                                picker.$emit('pick', date);
                            }
                        }, {
                            text: '一周前',
                            onClick(picker) {
                                const date = new Date();
                                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                                picker.$emit('pick', date);
                            }
                        }]
                    },
                    value1: '',
                    // picked : '1',
                    //父业传参
                    id: '',
                    //获取下拉菜单frequency
                    frequency: [],
                    //业务表单内容
                    Form: {
                        id: guidEmpty,
                        activeName: '',
                        planMain: '',
                        planDate: '',
                        frequency: '',
                        remarks: '',
                    },
                    //表单验证
                    rules: {
                        activeName: [
                            verification.NotNull,
                        ],
                        planMain: [
                            verification.NotNull,
                        ],
                        planDate: [
                            verification.NotNull,
                        ],
                        score: [
                            verification.NotNull,
                        ],
                        frequency: [
                            verification.NotNull,
                        ],
                        remarks: [
                            // verification.NotNullSelect
                        ],
                    }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/PersonSafePlanManagement/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/PersonSafePlanManagement/get?id=' + this.id);
                    this.Form.frequency = this.Form.frequency + "";
                },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "PersonSafePlanManagementInputPerson.html", id); },
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
                //获取下拉菜单内容
                this.frequency = getDicData('56');
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
        });
    </script>
</body>

</html>